package fr.kotton.myorganizer.task.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;

import fr.kotton.myorganizer.R;
import fr.kotton.myorganizer.task.fragment.ViewTaskFragment;
import fr.kotton.myorganizer.utils.Consts;

public class ViewTaskActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_task);

        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayShowTitleEnabled(false);

        Intent lIntent = getIntent();
        Integer lTaskId = lIntent.getIntExtra(Consts.INTENT_REF_TASK_ID, 0);

        Bundle lBundle = new Bundle();
        lBundle.putInt(Consts.INTENT_REF_TASK_ID, lTaskId);

        ViewTaskFragment lViewTaskFragment = new ViewTaskFragment();
        lViewTaskFragment.setArguments(lBundle);

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, lViewTaskFragment)
                    .commit();
        }
    }
}
